<%@ Page Title="Custom Settings" Language="C#" MasterPageFile="~/Views/Shared/Template.Master" Inherits="IWS.SiteManager.Web.Views.LayoutView<List<IWS.SiteManager.Core.Model.Setting>>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
	<div class="breadcrumb">
		<%=Html.ActionLink("Administration", "Index", "Manage") %> -&gt; Settings
	</div>

	<h2>Custom Settings</h2>
<%	using (Html.BeginForm())
	{%>
		<input type="submit" value="Save" />
		<table class="list">
<%		foreach (var group in Model.GroupBy(o => o.GroupName))
		{ %>
			<tr>
				<td colspan="2"><h3><%=group.Key%></h3></td>
			</tr>
			<tr>
				<th>Setting</th>
				<th>Value</th>
			</tr>
<%			foreach (var setting in group)
			{%>
			<tr>
				<td><label for="<%=string.Format("setting_{0}", setting.ID) %>"><%=setting.ID%></label></td>
				<td><%=Html.TextBox(string.Format("setting_{0}", setting.ID), setting.Value, new { @class="long"})%></td>
			</tr>
<%			} %>
<%		}%>
		</table>
<%	}%>
</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="EndBodyContent" runat="server">
</asp:Content>
